package com.fundcrawler.repository;// ConceptBoardRepository.java

import com.fundcrawler.entity.ConceptBoard;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;
import java.util.Optional;

public interface ConceptBoardRepository extends JpaRepository<ConceptBoard, Long> {
    @Query("SELECT c FROM ConceptBoard c ORDER BY c.createdTime DESC")
    List<ConceptBoard> findAllByOrderByCreatedTimeDesc();

    @Query("SELECT c FROM ConceptBoard c ORDER BY c.createdTime DESC")
    Optional<ConceptBoard> findTopByOrderByCreatedTimeDesc();
}
